#include <algorithm>
#include <vector>
#include <iostream>
using namespace std;
class Solution 
{
public:
    int MoreThanHalfNum_Solution(vector<int>& numbers)
    {
        sort(numbers.begin(), numbers.end());
        return numbers[(numbers.size() - 1) / 2];
    }
};

int main()
{
    int arr[] = { 1,2,3,2,2,2,5,4,2 };
    vector<int> v(arr, arr + sizeof(arr) / sizeof(int));
    Solution s;
    cout << s.MoreThanHalfNum_Solution(v) << endl;
    return 0;
}